﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="report.aspx.cs" Inherits="Xiaov.SmartWeb.Application.SZBB.report" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script src="../binary/dynaload.js" type="text/javascript"></script>
    <script type="text/javascript" language="JavaScript">
        function OnReady(id) {
            var tableName = '<%=tableName %>';
            var dwbm = '<%=dwbm %>';
            var nf = '<%=nf %>';
            var yf = '<%=yf %>';
            form1.AF.func("Build", "InitTable.aspx?tableName=" + tableName + "&dwbm=" + dwbm + "&nf=" + nf + "&yf=" + yf);
//            form1.AF.func("Build", "zz.xml");
        }
        function Retrieve() {
            var url = document.getElementById("source").value;
            form1.AF.func("Load", url);
            //      var rows = form1.AF.func("GetCellBackColor", "1\r\n1");
            //     alert(rows);
            //      var a = form1.AF.func("GetCellEditAble", "1\r\n1");
            for (var a = 0; a < 200; a++) {
                form1.AF.func("SetCellBackColor", a + "\r\n1\r\nyellow");
            }
            //      alert(a);
        }
        function showXML() {
            var tableName = '<%=tableName %>';
            var dwbm = '<%=dwbm %>';
            var nf = '<%=nf %>';
            var yf = '<%=yf %>';
            var xml = encodeURIComponent(form1.AF.func('GetFileXML', ''));
            //                        alert(xml);
            $.ajax({
                type: "post",
                url: "SaveTable.aspx",
                dataType: "json",
                data: { nf: nf, yf: yf, dwbm: dwbm, tableName: tableName, xml: xml },
                success: function (data) {
                    var jsonData = data;
                    if (jsonData.save == 0)
                    { alert("保持失败"); }
                    else
                    { alert("保持成功"); }
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    alert(errorThrown);
                }
            });
        }
        function addRow() {
            form1.AF.func('InsertRows', "3");
        }

    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div style="position: relative; width: 96%; height: 700px">
        <input type="button" value=" 取数 " onclick="showXML()" />
        <input type="button" value=" 增加 " onclick="addRow()" />
        <input id="Hidden1" type="hidden" />
        <script type="text/javascript">            insertReport('AF', 'Rebar=Print,Font;WorkMode=UploadRunTime;isHiLightTabOrder=false')</script>
    </div>
    </form>
</body>
</html>
